home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1989 January / Ahoy_Magazine_89-01_1989_Double_L.d64 / Quickly Random (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  489b  |  16 lines

  1. 0 print"[147]            quickly random":poke53280,1:poke53281,1
  2. 1 rem =================================
  3. 2 rem  commodares problem #57-1 :
  4. 3 rem      quickly random
  5. 4 rem  solution by
  6. 5 rem      bob rispoli
  7. 6 rem =================================
  8. 10 dimx(100):forj=1to100:x(j)=j:next
  9. 15 ti$="000000"
  10. 20 forj=1to100:n=int(rnd(1)*100)+1:a=x(n):x(n)=x(j):x(j)=a:next
  11. 25 print ti"jiffies"
  12. 30 printtab(16)" done [146]"
  13. 40 print:print"to see the rearranged array hit any key"
  14. 50 geta$:ifa$=""goto50
  15. 60 forj=1to100:printtab(15)"x"j"="x(j):ford=1to200:next:next
  16.